import { EntitySchema } from '@mikro-orm/core';

export class TypechoViolation {
  id!: number;
  uid: number = 0;
  type?: string;
  text?: string;
  created?: number = 0;
  handler?: number = 0;
}

export const TypechoViolationSchema = new EntitySchema({
  class: TypechoViolation,
  properties: {
    id: { primary: true, type: 'number' },
    uid: { type: 'number', default: 0 },
    type: { type: 'string', length: 255, nullable: true },
    text: { type: 'string', columnType: 'text', nullable: true },
    created: { type: 'number', nullable: true, default: 0 },
    handler: { type: 'number', nullable: true, default: 0 },
  },
});
